package packet;

import java.nio.ByteBuffer;

public class GCOperationResultResp extends Packet 
{
	public GCOperationResultResp(int SN, int result)
	{
		super(PacketConstant.PACKET_RESPONSE_RESULT, SN);
		
		resultCode = result;
	}
	
	public int writeToBuffer(ByteBuffer buffer)
	{
		int mark = buffer.position();
		
		super.writeToBuffer(buffer);
		
		buffer.putInt(resultCode);
		
		return (buffer.position() - mark);
	}
	
	public String getPacketName()
	{
		return "GCOperationResultResp";
	}
	
	public String getPacketDetail() 
	{
		String detail = String.format("resultCode=%d", resultCode);
		
		return detail;
	}
	
	public int getPacketSize()
	{
		return super.getPacketSize() + 4;
	}
	
	private int resultCode;
}
